<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAuthRulesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('auth_rules', function (Blueprint $table) {
            $table->id();
            $table->foreignId('fid')->default(0)->comment('父ID');
            $table->string('title',20)->comment('标题');
            $table->string('url',100)->comment('接口链接');
            $table->string('icon',50)->nullable()->comment('菜单图标');
            $table->string('component',100)->nullable()->comment('前端组件');
            $table->string('router',100)->nullable()->comment('前端路由');
            $table->timestamps();
        });
        DB::statement("ALTER TABLE `auth_rules` comment '权限节点表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('rules');
    }
}
